#include "searcher.hpp"

int main()
{
    yjz_searcher::Searcher *search = new yjz_searcher::Searcher();
    search->InitSearcher("data/raw_html/raw.txt");
    std::string query;
    std::string json_string;
    char buffer[1024];
    while (true)
    {
        std::cout << "please enter your search query: ";
        fgets(buffer, sizeof(buffer) - 1, stdin);
        buffer[strlen(buffer) - 1] = 0;
        query = buffer;
        search->Search(query, &json_string);
        std::cout << json_string << std::endl;
    }
    return 0;
}